<h1>User and Photo Search</h1>
<form method="post" action="<?php echo BASE_PATH; ?>/aggregators/search">
    <fieldset>
        <label for="query">Search for:</label>
        <input type="text" name="query" id="query" /><br />

        <input type="submit" name="submit" id="submit" value="Search" />
    </fieldset>
</form>
<?php if (isset($user_result)): ?>
<div id="search" class="section">
    <h1>Search Result for Users</h1>
    <?php foreach($user_result as $user): ?>
    <div class="profile-photo">
        <a href="<?php echo BASE_PATH; ?>/users/view/<?php echo $user["User"]["id"]; ?>"><img src="<?php echo BASE_PATH; ?>/photos/thumbs/<?php echo $user["Photo"]["filename"]; ?>" alt=""/></a>
    </div>
    <div class="profile-details">
        <p><a href="<?php echo BASE_PATH; ?>/users/view/<?php echo $user["User"]["id"]; ?>"><?php echo $user["User"]["name"]; ?></a></p>
    </div>
    <div class="clear"></div>
    <?php endforeach ?>
</div>
<?php endif ?>
<?php if (isset($photo_result)): ?>
<div class="section">
    <h1>Search Result for Photos</h1>
    <ul class="thumbnails">
        <?php foreach($photo_result as $photo): ?>
            <li>
                <a href="<?php echo BASE_PATH; ?>/photos/view/<?php echo $photo["Photo"]["id"]; ?>"><img src="<?php echo BASE_PATH; ?>/photos/thumbs/<?php echo $photo["Photo"]["filename"]; ?>" alt="description" /><img src="<?php echo BASE_PATH; ?>/photos/thumbs/<?php echo $photo["Photo"]["filename"]; ?>" alt="description" class="preview" /></a>
            </li>
        <?php endforeach ?>
    </ul>
    <div class="clear"></div>
</div>
<?php endif ?>